<template>
  <div>
    <c-table border :columns="tableColumns" :data="tableData"></c-table>
    <div class="query-pagination">
      <div></div>
      <el-pagination
        layout="total, prev, pager, next, jumper"
        :current-page.sync="params.index"
        :page-size="params.size"
        :total="totalCount"
        @current-change="getData"
      ></el-pagination>
    </div>

    <report-view-dialog :visible.sync="viewVisible" :report-data="viewRow"></report-view-dialog>
  </div>
</template>

<script>
import ReportViewDialog from '@/credit/views/city/report/ReportViewDialog'

export default {
  components: {
    ReportViewDialog,
  },
  props: {
    reportType: Number,
  },
  data() {
    return {
      loading: false,
      params: {
        index: 1,
        size: 10,
      },
      tableName: 'customer_info_report',
      totalCount: 0,
      tableData: [],
      tableColumns: [
        { attrs: { label: '报表名称', prop: 'title', align: 'center' } },
        { attrs: { label: '任务生成方式', prop: 'tbd2', align: 'center' } },
        { attrs: { label: '报表完成时间', prop: 'tbd3', align: 'center' } },
        {
          attrs: { label: '操作', align: 'center', minWidth: 120 },
          operations: [
            { content: '查看', icon: 'fa fa-search', event: this.handleView },
            {
              content: '下载',
              icon: 'fa fa-download',
              event: this.handleDownload,
            },
          ],
        },
      ],

      viewVisible: false,
      viewRow: {},
    }
  },
  computed: {},
  watch: {},
  created() {
    this.getData()
  },
  mounted() {},
  methods: {
    async getData() {
      this.totalCount = 0
      this.tableData = []
    },
    handleView(row = {}) {
      this.viewRow = row
      this.viewVisible = true
    },
    handleDownload() {},
  },
}
</script>

<style lang="scss" scoped></style>
